inspector: Update all statistics in same place
authorBenjamin Otte <otte@redhat.com>
Mon, 13 Oct 2014 08:09:48 +0000 (10:09 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 14 Oct 2014 12:03:06 +0000 (14:03 +0200)
gtk/inspector/statistics.c

index f41567b07566ac51cbcf868e384a8f1df1edfe14..f6f04a30f822db9266ede5a52a9cf23d9c58aaca 100644 (file)
@@ -91,6 +91,8 @@ add_type_count (GtkInspectorStatistics *sl, GType type)
   self = g_type_get_instance_count (type);
   cumulative += self;
 
+  data->self1 = data->self2;
+  data->cumulative1 = data->cumulative2;
   data->self2 = self;
   data->cumulative2 = cumulative;
 
@@ -123,13 +125,6 @@ refresh_clicked (GtkWidget *button, GtkInspectorStatistics *sl)
   TypeData *data;
   GtkTreeIter treeiter;
 
-  g_hash_table_iter_init (&iter, sl->priv->counts);
-  while (g_hash_table_iter_next (&iter, NULL, (gpointer *)&data))
-    {
-      data->self1 = data->self2;
-      data->cumulative1 = data->cumulative2;
-    }
-
   if (sl->priv->snapshot_count == 0)
     {
       gtk_tree_view_column_set_visible (sl->priv->column_self2, TRUE);